int is_in_net(unsigned char *ip, unsigned char *netip, unsigned char *mask) {
    for (int i = 0; i < 4; i++) {
        // 按位与运算，判断每一段是否匹配
        if ((ip[i] & mask[i]) != (netip[i] & mask[i])) {
            return 0;
        }
    }
    return 1;
}